#include <iostream>

#include "Light.h"
#include "ConcreteLightStates.h"

using namespace std;

void printCurrentState(Light light);

int main(void)
{
    Light light;

    cout << "/************** Program Start ***************/" << endl;

    printCurrentState(light);

    light.nextState();
    printCurrentState(light);
    
    light.nextState();
    printCurrentState(light);

    light.nextState();
    printCurrentState(light);

    light.nextState();
    printCurrentState(light);

    return 0;
}

void printCurrentState(Light light)
{
    if(light.getCurrentState() == &LightOff::getInstance()) {
        cout << "currentState: Light_Off" << endl;
    } else if(light.getCurrentState() == &LowIntensity::getInstance()) {
        cout << "currentState: Light_Low" << endl;
    } else if(light.getCurrentState() == &MediumIntensity::getInstance()) {
        cout << "currentState: Light_Medium" << endl;
    } else if(light.getCurrentState() == &HighIntensity::getInstance()) {
        cout << "currentState: Light_High" << endl;
    } else {
        cout << "currentState: ERROR STATE!" << endl;
    }
}
